﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LibSnesDotNet.Threading
{
	class ReadOnlyWaitableBool : IWaitableBool
	{
		public static implicit operator bool(ReadOnlyWaitableBool value)
		{
			return value.Value;
		}

		WaitableBool _wBool;

		public ReadOnlyWaitableBool(WaitableBool wBool)
		{
			if (wBool == null) { throw new ArgumentNullException("wBool"); }

			_wBool = wBool;
		}

		public bool Value { get { return _wBool.Value; } }

		public void WaitUntil()
		{
			_wBool.WaitUntil();
		}

		public void WaitWhile()
		{
			_wBool.WaitWhile();
		}

		public void WaitFor(bool value)
		{
			_wBool.WaitFor(value);
		}
	}
}
